import request from '@/utils/request'

// 获取企业列表
export function getEnterpriseList(params) {
  return request({
    url: '/park/enterprise',
    params
  })
}

// 获取行业字段列表
export function getIndustryListAPI() {
  return request({
    url: '/park/industry'
  })
}

// 上传营业执照
export function uploadAPI(data) {
  return request({
    url: '/upload',
    method: 'POST',
    data
  })
}

// 增加企业
export function addEnterpriseAPI(data) {
  return request({
    url: '/park/enterprise',
    method: 'post',
    data
  })
}

// 查看企业
export function getEnterpriseAPI(id) {
  return request({
    url: `/park/enterprise/${id}`

  })
}

// 删除企业
export function deleteEnterpriseAPI(id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'delete'
  })
}

// 获取可租楼宇
export function getBuildingListAPI() {
  return request({
    url: '/park/rent/building'
  })
}

// 添加合同
export function addContractAPI(data) {
  return request({
    url: '/park/enterprise/rent',
    method: 'post',
    data
  })
}

// 获取合同列表
export function getContractListAPI(id) {
  return request({
    url: `/park/enterprise/rent/${id}`
    // params: { id }

  })
}

// 退租租赁合同
export function deleteContractAPI(id) {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: 'delete'

  })
}

// 查看企业
export function getEnterpriseDetail(id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'GET'
  })
}
